#pragma once
#include "Vec3.h"
#include "Line3D.h"

enum Plane2Line{
	NP_ALL_LINE,
	NP_PARALLEL,
	NP_POINT
};

class Plane {
protected:
	float a;
	float b;
	float c;
	float d;
public:
	Plane(const Vec3& p0, const Vec3& p1, const Vec3& p2);
	Plane2Line intersect(const Line3D& line, Vec3* ret);
};
/*
	public enum Plane2Line{
		ALL_LINE,
		PARALLEL,
		POINT
	}

	public class Plane2LineResult{
		Plane2Line type;
		Vec3 p;
	}

	public Plane2LineResult intersect(Line3D line){
		Plane2LineResult ret = new Plane2LineResult();
		float den = a*line.dir.x + b*line.dir.y
			+ c*line.dir.z;
		float num = a*line.p.x + b*line.p.y
        	+ c*line.p.z + d;
		if (den==0){
			if (num==0){
				ret.type = Plane2Line.ALL_LINE;
			}else{
				ret.type = Plane2Line.PARALLEL;
			}
		}else{
			ret.type = Plane2Line.POINT;
			float num_div_den = num/den;
			ret.p = new Vec3(
						line.p.x - num_div_den * line.dir.x,
						line.p.y - num_div_den * line.dir.y,
						line.p.z - num_div_den * line.dir.z
					);
		}
		return ret;
	}

	public enum Plane2Plane{
		IDENTICAL,
		LINE
	}

	public class Plane2PlaneResult{
		Plane2Plane type;
		Line3D l;
	}
}
*/
